import Vue from 'vue'
import Router from 'vue-router'
import HomeContainer from './components/tarbar/HomeContainer'
import MemberContainer from './components/tarbar/MemberContainer'
import ShopcarContainer from './components/tarbar/ShopcarContainer'
import SearchContainer from './components/tarbar/SearchContainer'
import NewsList from './components/news/NewsList'
import NewsInfo from './components/news/NewsInfo'
import PhotoList from './components/photos/photoList'


Vue.use(Router)

export default new Router({
  mode: 'history',
  base: process.env.BASE_URL,
  linkActiveClass: 'mui-active', // 覆盖默认路由高亮的类router-link-active
  routes: [
    {
      path: '/',
      redirect: '/home'
    },
    {
      path: '/home',
      name: 'home',
      component: HomeContainer
    },
    {
      path: '/member',
      name: 'member',
      component: MemberContainer
    },
    {
      path: '/shopcar',
      name: 'shopcar',
      component: ShopcarContainer
    },
    {
      path: '/search',
      name: 'search',
      component: SearchContainer
    },
    {
      path: '/home/newsList',
      name: 'newsList',
      component: NewsList
    },
    {
      path: '/home/newsInfo/:id',
      name: 'newsInfo',
      component: NewsInfo
    },
    {
      path: '/home/photoList',
      name: 'photoList',
      component: PhotoList
    }


    // {
    //   path: '/About',
    //   name: 'about',
    //   // route level code-splitting
    //   // this generates a separate chunk (about.[hash].js) for this route
    //   // which is lazy-loaded when the route is visited.
    //   component: () => import(/* webpackChunkName: "about" */ './views/About.vue')
    // }
  ]
})
